package com.demo.seckill.mybatis;

import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.annotations.*;

/**
 * @author libo
 * @ClassName UserInfoWithAddress
 * @date 2019/2/25 16:50
 */
@Mapper
public interface UserInfoWithAddressMapper {
    @Results({
            @Result(property = "name", column = "username")
    })
    @Select("select u.id,u.username,u.age,u.sex,a.province,a.city from userinfo u JOIN  address a on u.address_id = a.id  and u.id=#{id}")
    UserInfoWithAddress getUser(int id);
}
